<template>
    <div class="product-list">
      <h2>商品列表</h2>
      <div class="product-grid">
        <div v-for="item in products" :key="item.id" class="product-card">
          <img :src="item.image" alt="商品图片">
          <h3>{{ item.name }}</h3>
          <p>¥{{ item.price }}</p>
          <el-button type="primary">加入购物车</el-button>
        </div>
      </div>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue'
  
 
  </script>
  
  <style scoped>
  .product-list {
    padding: 20px;
  }
  
  .product-card {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
  }
  
  .product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
  }
  </style>